package cn.yuanqiao.archive.appManager.mapper;

import cn.yuanqiao.archive.appManager.domain.TenantItemFolder;
import cn.yuanqiao.archive.appManager.domain.TenantYqFolder;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author zjj
 * @date 2023/6/15
 */
public interface TenantYqFolderMapper {
    /**
     * 创建卷总表
     * @param yqFolder
     * @return
     */
    int createYqFolderTable(TenantYqFolder yqFolder);

    /**
     * 添加卷分表数据
     * @param folder
     * @return
     */
    int insertYqFolderDisperse(TenantYqFolder folder);

    /**
     * 添加卷总表
     * @param folder
     * @return
     */
    int insertYqFolder(TenantYqFolder folder);

    /**
     * 项目和卷关联关系
     * @param itemFolder
     * @return
     */
    int addItemFolder(TenantItemFolder itemFolder);

    int updateYqFolderDisperse(TenantYqFolder folder);

    int updateYqFolder(TenantYqFolder folder);

    Map<String, Object> getYqFolderById(@Param("column")String column, @Param("id") Long id, @Param("tableName") String tableName);

    Map<String, Object> getYqFolderAllById(@Param("column")String column, @Param("id") Long id, @Param("tableName") String tableName);

    String getYqFolderAllXMBH(@Param("column")String column, @Param("id")String id, @Param("tableName") String tableName);

    Long[] getFolderIdsByItemIds(@Param("ids")Long[] ids, @Param("tableName") String tableName, @Param("itemFolderTableName")String itemFolderTableName);

    int updateYqFolderByIds(@Param("folder")TenantYqFolder folder, @Param("ids") Long[] ids);

    int updateYqFolderDisperseByIds(@Param("folder")TenantYqFolder folder, @Param("ids") Long[] ids);

    int delFolderByIds(@Param("folderIds")String folderIds, @Param("tableName") String tableName);

    int delFolderDisperseByIds(@Param("folderIds")String folderIds, @Param("tableName") String tableName);

    int DhIsNull(@Param("ids")Long[] ids, @Param("juanDhCol") String juanDhCol, @Param("tableName") String tableName);

    Integer getCountByCol(@Param("checkChongfu")String checkChongfu, @Param("val")String val, @Param("tableName")String tableName);

    int updateStateByPackageId(@Param("state")int state,@Param("folderTableName") String folderTableName,@Param("onLineTableName") String onLineTableName,@Param("onlineReceptionId")Long onlineReceptionId);

    void delFolderByIdList(@Param("tableName")String tableName,@Param("ids") List<Long> ids);

    void delYqFolder(@Param("folderId") Long folderId,@Param("tableName") String tableName);
}
